﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.Text.Json.Serialization;
using System.ComponentModel;

namespace ProjectN.Core.Instance.Data
{
    public interface IDataSpreader
    {
        [Browsable(false)]
        [JsonIgnore]
        public InstanceData Data { get; set; }
    }

    public abstract class DataSpreader : IDataSpreader
    {
        private InstanceData data = null!;

        [JsonIgnore]
        [Browsable(false)]
        public InstanceData Data
        {
            get => data;
            set
            {
                data = value;
                UpdateData(value);
            }
        }
        protected abstract void UpdateData(InstanceData data);
    }

    public abstract class DataReceiver : IDataSpreader
    {
        [JsonIgnore]
        [Browsable(false)]
        public InstanceData Data { get; set; } = null!;
    }
}
